home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / utility / ffe101.zip / ANIM.SWG / 0007_FLT TWE OPT.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-03  |  19KB  |  407 lines

  1. --------a-FLT-------------------------------
  2.  
  3. The FLC files are files created by the Autodesk Animator Pro and contain
  4. animations.  The  FLC  files  are a  superset  of  those  created by the
  5. Autodesk  Animator  (FLIc  files).  In some  cases,  new  data fields or
  6. compression  methods were added. The FLC  files use a hierarchical block
  7. oriented  structure and blocks are  a combination of control information
  8. and data. The file consists of one header followed by data blocks. It is
  9. possible that new types of blocks not described in this document will be
  10. added  to  animation  files in the  future.  It  is recommended that you
  11. quietly  ignore  unknown  block  types  you  encounter  during animation
  12. playback.  The size fields in the block  headers make it easy to skip an
  13. entire unrecognized block.
  14.  
  15. The  FLC  files consist of one 128-byte  header block and one or more of
  16. the following blocks :
  17.  
  18. The   prefix   block,  if  present,   contains   Animator  Pro  settings
  19. information, CEL placement information, and other auxiliary data.
  20.  
  21. A  frame  block exists for each frame  in  the animation. In addition, a
  22. ring  frame follows all the animation  frames. Each frame block contains
  23. color palette information and/or pixel data.
  24.  
  25. The  ring  frame contains delta-compressed  information to loop from the
  26. last  frame of the flic back to the first. It can be helpful to think of
  27. the  ring frame as a copy of  the first frame, compressed in a different
  28. way.  All flic files will contain a ring frame, including a single-frame
  29. flic.
  30.  
  31. The FLC file header
  32.  
  33. OFFSET              Count TYPE   Description
  34. 0000h                   1 dword  The size of the whole animation file,
  35.                                  including the size of this header.
  36. 0004h                   1 word   ID=0AF12h
  37. 0006h                   1 word   Number of frames in this animation, not
  38.                                  including the ring frame. FLC files have
  39.                                  a maximum length of 4000 frames.
  40. 0008h                   1 word   Screen width in pixels
  41. 000Ah                   1 word   Screen height in pixels
  42. 000Ch                   1 word   Bits per pixel (always 8)
  43. 000Eh                   1 word   Flags - bitmapped
  44.                                  0 - Ring frame not written / ring frame
  45.                                      written
  46.                                  1 - Flic header not updated / updated
  47.                               2-15 - reserved
  48. 0010h                   1 dword  Delay between frames in miliseconds.
  49. 0014h                   1 word   reserved
  50. 0016h                   1 dword  MS-DOS date and time of file creation
  51. 001Ah                   1 dword  Serial number of the Animator Pro program
  52.                                  used to create the file. If the file was
  53.                                  created with the FlicLib development kit,
  54.                                  this value equals 0464c4942h ("FLIB").
  55. 001Eh                   1 dword  MS-DOS date and time of last modification
  56. 0022h                   1 dword  Serial number of program that made the last
  57.                                  modification. See Serial Number.
  58. 0026h                   1 word   X-axis aspect ratio of the file
  59. 0028h                   1 word   Y-axis aspect ratio of the file
  60.                                  (320x200 = 6:5)
  61. 002Ah                  38 byte   reserved (0)
  62. 0050h                   1 dword  Offset from begin of file to the first
  63.                                  animation frame block.
  64. 0054h                   1 dword  Offset from begin of file to the second
  65.                                  animation frame block. This value is used
  66.                                  when looping the animation.
  67. 0058h                  40 byte   reserved (0)
  68.  
  69. Each  subblock in the animation file  has an identical header structure,
  70. which is formatted like this :
  71.  
  72. 0000h                   1 dword  The size of the whole block and all subordinate
  73.                                  blocks including the size of this header
  74. 0004h                   1 word   Block ID, varies depending on the block type.
  75. 0006h                   1 word   Number of subordinate blocks in this block.
  76.                                  including the ring frame. FLC files have a
  77.                                  maximum length of 4000 frames.
  78. 0008h                   8 byte   reserved(0)
  79.  
  80. Immediately  after  the  header there may  be  an optional prefix block,
  81. which is used to store additional data which is not directly involved in
  82. animation playback.
  83.  
  84. The  prefix block has the usual header  with an ID of 0F100h. The prefix
  85. block  should only be created by the  Animator Pro programs and never by
  86. any other software, it is to be ignored by other software.
  87.  
  88. The  FLC  frame  blocks contain the  information  to convert the current
  89. frame into the next frame; they have an ID of 0F1FAh. Directly after the
  90. frame  header,  there are the subordinate  data blocks - if the subblock
  91. count  is  0  this  means, that the  current  frame  is identical to the
  92. previous  frame,  only  the appropriate delay  has  to be made. The data
  93. blocks have a different header format :
  94.  
  95. OFFSET              Count TYPE   Description
  96. 0000h                   1 dword  Size of this block, including header size
  97. 0004h                   1 word   Data type identifier :
  98.                                   4 - 256-level color palette info
  99.                                   7 - Word-oriented delta compression
  100.                                  11 - 64-level color palette info
  101.                                  12 - Byte-oriented delta compression
  102.                                  13 - Entire frame is color index 0
  103.                                  15 - Byte run length compression
  104.                                  16 - No compression
  105.                                  18 - Postage stamp sized image
  106. 0006h                   ? byte   Color or pixel data
  107.  
  108. The  following sections describe each of  these data encoding methods in
  109. detail.
  110.  
  111. --- Block Type  4 (FLI_COLOR256) - 256-Level Color
  112.  
  113. The data in this block is organized in packets. The first word following
  114. the block header is a count of the number of packets in the blocks. Each
  115. packet  consists of a one-byte color  index skip count, a one-byte color
  116. count and three bytes of color information for each color defined.
  117.  
  118. At the start of the block, the color index is assumed to be zero. Before
  119. processing  any colors in a packet, the  color index skip count is added
  120. to  the current color index. The number  of colors defined in the packet
  121. is retrieved. A zero in this byte indicates 256 colors follow. The three
  122. bytes  for each color define the red,  green, and blue components of the
  123. color  in that order. Each component can range from 0 (off) to 255 (full
  124. on). The data to change colors 2,7,8, and 9 would appear as follows:
  125.  
  126.      2                      ; two packets
  127.      2,1,r,g,b              ; skip 2, change 1
  128.      4,3,r,g,b,r,g,b,r,g,b  ; skip 4, change 3
  129.  
  130. --- Block Type 11 (FLI_COLOR) - 64-Level Color
  131.  
  132. This  block is identical to FLI_COLOR256  except that the values for the
  133. red,  green  and  blue components are in  the  range  of 0-63 instead of
  134. 0-255, i.e. in native VGA values which can be written to the VGA without
  135. modification.
  136.  
  137. --- Block Type 13 (FLI_BLACK) - No Data
  138.  
  139. This block has no data following the header. All pixels in the frame are
  140. set to color index 0.
  141.  
  142. --- Block Type 16 (FLI_COPY) - No Compression
  143.  
  144. This  block contains an uncompressed raw  image of the frame, from upper
  145. left  to  the lower right, storing  each line sequentially. This type of
  146. block  is  created when the preferred  compression  method (SS2 or BRUN)
  147. generates more data than the uncompressed frame image; a relatively rare
  148. situation.
  149.  
  150. --- Block Type 15 (FLI_BRUN) - Byte Run Length Compression
  151.  
  152. This  block  contains the entire image  in  a compressed format. Usually
  153. this  block  is  used in the first  frame  of  an animation, or within a
  154. postage stamp image block.
  155.  
  156. The data is organized in lines. Each line contains packets of compressed
  157. pixels.  The  first  line is at the  top  of  the animation, followed by
  158. subsequent  lines moving downward. The number  of lines in this block is
  159. given by the height of the animation.
  160.  
  161. The  first  byte  of each line is a  count  of packets in the line. This
  162. value  is  ignored, it is a holdover  from  the original Animator. It is
  163. possible  to generate more than 255 packets  on a line. The width of the
  164. animation  is  now  used  to drive the  decoding  of  packets on a line;
  165. continue  reading  and processing packets  until  width pixels have been
  166. processed, then proceed to the next line.
  167.  
  168. Each packet consist of a type/size byte, followed by one or more pixels.
  169. If  the number is negative (the high bit of the packet type is set), the
  170. absolute  value  is the count of pixels  to be copied from the packet to
  171. the  animation  image, otherwise the next  byte  contains a single pixel
  172. which  is to be replicated; The lower 7 bits are the number of times the
  173. pixel is to be replicated.
  174.  
  175. --- Block Type 12 (FLI_LC) - Byte Aligned Delta Compression
  176.  
  177. This  block contains the differences between the previous frame and this
  178. frame. This compression method was used by the original Animator, but is
  179. not  created  by  Animator  Pro. This type  of  block  can  appear in an
  180. Animator  Pro  file,  however,  if the  file  was  originally created by
  181. Animator,  then  some (but not all)  frames were modified using Animator
  182. Pro.
  183.  
  184. The  first word following the block  header contains the position of the
  185. first  line in the block. This is a count of lines (down from the top of
  186. the  image)  which are unchanged from  the  prior frame. The second word
  187. contains  the  number  of  lines in the  block.  The  data for the lines
  188. follows these two words.
  189.  
  190. Each  line begins with two bytes. The first byte contains the starting x
  191. position  of  the  data on the line,  and  the second byte the number of
  192. packets  for  the  line. Unlike BRUN  compression,  the  packet count is
  193. significant  (because  this compression method  is  only used on 320x200
  194. flics).
  195.  
  196. Each  packet consists of a single byte column skip, followed by a packet
  197. type/ size byte, which has the reverse meaning of in the block type 15.
  198.  
  199. --- Block Type  7 (FLI_SS2) - Word Aligned Delta Compression
  200.  
  201. This format contains the differences between consecutive frames. This is
  202. the  format  most often used by Animator  Pro  for frames other than the
  203. first  frame of an animation. It is similar to the line coded delta (LC)
  204. compression,  but is word oriented instead of byte oriented. The data is
  205. organized into lines and each line is organized into packets.
  206.  
  207. The  first  word  in the data  following  the  block header contains the
  208. number  of  lines in the block. Each  line  can begin with some optional
  209. words  that are used to skip lines and set the last byte in the line for
  210. animations with odd widths. These optional words are followed by a count
  211. of  the  packets  in the line. The  line  count does not include skipped
  212. lines.
  213.  
  214. The high order two bits of the word is used to determine the contents of
  215. the word :
  216.  
  217.      Bit 15  Bit 14       Meaning
  218.  
  219.        0      0           The word contains the packet count. The packets
  220.                           follow this word. The packet count can be zero;
  221.                           this occurs when only the last pixel on a line
  222.                           changes.
  223.  
  224.        1      0           The low order byte is to be stored in the last byte
  225.                           of the current line. The packet count always follows
  226.                           this word.
  227.  
  228.        1      1           The word contains a line skip count. The number of
  229.                           lines skipped is given by the absolute value of the
  230.                           word.  This word can be followed by more skip counts,
  231.                           by a last byte word, or by the packet count.
  232.  
  233. The  packets in each line are similar  to the packets for the line coded
  234. block.  The first byte of each packet is a column skip count. The second
  235. byte  is a packet type. If the  packet type is positive, the packet type
  236. is a count of words to be copied from the packet to the animation image.
  237. If  the packet type is negative, the packet contains one more word which
  238. is  to  be replicated. The absolute value  of  the packet type gives the
  239. number  of  times the word is to  be  replicated. The high and low order
  240. byte in the replicated word do not necessarily have the same value.
  241.  
  242. --- Block Type 18 (FLI_PSTAMP) - Postage Stamp Image
  243.  
  244. This  block  type holds a postage stamp  - a reduced-size image - of the
  245. frame.  It generally appears only in the first frame block within a flic
  246. file.  When  creating a postage stamp,  Animator Pro considers the ideal
  247. size  to  be  100x63  pixels. The actual  size  will  vary  as needed to
  248. maintain  the same aspect ratio as the original. The pixels in a postage
  249. stamp  image  are mapped into a  six-cube color space, regardless of the
  250. color  palette settings for the full frame image. A six-cube color space
  251. is formed as follows:
  252.  
  253.      start at palette entry 0
  254.      for red = 0 thru 5
  255.           for green = 0 thru 5
  256.                for blue = 0 thru 5
  257.                     palette_red   = (red   * 256)/6
  258.                     palette_green = (green * 256)/6
  259.                     palette_blue  = (blue  * 256)/6
  260.                     move to next palette entry
  261.                end for blue
  262.           end for green
  263.      end for red
  264.  
  265. Any  arbitrary rgb value (where each component is in the range of 0-255)
  266. can be mapped into the six-cube space using the formula:
  267.  
  268.   ((6*red)/256)*36 + ((6*green)/256)*6 + ((6*blue)/256)
  269.  
  270. The full postage stamp block header is defined as follows:
  271.  
  272. Offset  Length  Name         Description
  273. OFFSET              Count TYPE   Description
  274. 0000h                   1 dword  Size of this block, including header size
  275. 0004h                   1 word   ID=18
  276. 0006h                   1 word   Height of the postage stamp image
  277. 0008h                   1 word   Width of the image
  278. 000Ah                   1 word   Color translation type :
  279.                                  1 - six-cube color space
  280.  
  281. Immediately following this header is the postage stamp data. The data is
  282. formatted  as  a block with standard  size/type header. The type will be
  283. one of:
  284.  
  285.      15     FPS_BRUN         Byte run length compression
  286.      16     FPS_COPY         No compression
  287.      18     FPS_XLAT256      Six-cube color xlate table
  288.  
  289. The  FPS_BRUN  and  FPS_COPY  types are  identical  to  the FLI_BRUN and
  290. FLI_COPY encoding methods described above.
  291.  
  292. The  FPS_XLAT256 type indicates that the block contains a 256-byte color
  293. translation table instead of pixel data. To process this type of postage
  294. stamp, read the pixel data for the full-sized frame image, and translate
  295. its  pixels  into  six-cube space using  a  lookup in the 256-byte color
  296. translation  table. This type of postage  stamp appears when the size of
  297. the  animation frames is smaller than  the standard 100x63 postage stamp
  298. size.
  299.  
  300. *************
  301.  
  302. TWE - Tween Data Files
  303.  
  304. A  TWE file holds information about a  tweening operation set up via the
  305. Tween  menus.  The information includes  the starting and ending shapes,
  306. and  the optional userD specified links between the shapes. Animator Pro
  307. creates tween files.
  308.  
  309. A TWE file begins with an 8-byte header defined as follows:
  310.  
  311. Offset  Length  Name         Description
  312.  
  313.   0       2     magic        File format identifier. Always hex 1995.
  314.  
  315.   2       2     version      The file format version; always zero.
  316.  
  317.   4       4     tcount       The number of tween shapes in the file;
  318.                              always 2.
  319.  
  320.   8       8     reserved     Unused space; set to zeroes.
  321.  
  322.   16      4     linkcount    The number of link entries in the file.
  323.  
  324. Immediately  following  the  file header are  the  link  entries. If the
  325. linkcount value is zero there are no links. Each link entry is a pair of
  326. 32-bit  integers. The first value in each pair is the index of the point
  327. in  the  first shape, and the second value  is the index of the point in
  328. the  ending  shape.  (IE, a link value  of  2,7  says to link the second
  329. starting-shape point to the seventh ending-shape point.)
  330.  
  331. Following the link entries is the data block that describes the starting
  332. shape,  then the data block that  describes the ending shape. The format
  333. of  these  blocks  is  identical  to  that  of  the  polygon (PLY) file,
  334. including  file header data. In other words, they appear as if a pair of
  335. polygon files are embedded in the tween file at this point.
  336.  
  337. **********
  338.  
  339. OPT - Optics Menu Settings Files
  340.  
  341. An  OPT file holds information about an  optics operation set up via the
  342. Optics  menus.  Both Animator Pro and  the  original Animator create OPT
  343. files. The file format is the same for both.
  344.  
  345. An OPT file starts with a 4-byte header, as follows:
  346.  
  347. Offset  Length  Name         Description
  348.  
  349.   0       2     magic        File type identifier.  Always hex 1A3F.
  350.  
  351.   2       2     count        Number of records in the file.
  352.  
  353. Following  the file header are optics records of 50 bytes each. A record
  354. is  generated  for each click on CONTINUE  MOVE  in the OPTICS menu. The
  355. move records are formatted as follows:
  356.  
  357. Offset  Length  Name         Description
  358.  
  359.   0       4     link         In the file, this field is always zero.
  360.                              In memory, it's a pointer to the next
  361.                              move record.
  362.  
  363.   4       6     spincenter   The x,y,z coordinates of the spin
  364.                              center point; three 16-bit values.
  365.  
  366.   10      6     spinaxis     The x,y,z coordinates of the spin axis;
  367.                              three 16-bit values.
  368.  
  369.   16      6     spinturns    The x,y,z coordinates of the spin turns;
  370.                              three 16-bit values.
  371.  
  372.   22      4     spininter    Intermediate turns.  Two 16-bit values.
  373.                              These are values for a conjugation matrix
  374.                              that corresponds to spin axis.
  375.  
  376.   26      6     sizecenter   The x,y,z coordinates of the size
  377.                              center point; three 16-bit values.
  378.  
  379.   32      2     xmultiplier  Determines (along with xdivisor)
  380.                              how to scale along x dimension.
  381.  
  382.   34      2     xdivisor     Determines (along with xmultiplier) how
  383.                              to scale along x dimension.
  384.  
  385.   36      2     ymultiplier  Determines (along with ydivisor)
  386.                              how to scale along y dimension.
  387.  
  388.   38      2     ydivisor     Determines (along with ymultiplier) how
  389.                              to scale along y dimension.
  390.  
  391.   40      2     bothmult     Like xmultiplier, but applied to both
  392.                              dimensions.
  393.  
  394.   42      2     bothdiv      Like xdivisor, but applied to both
  395.                              dimensions.
  396.  
  397.   44      6     linearmove   The x,y,z offset for a linear move;
  398.                              three 16-bit values.
  399.  
  400. EXTENSION:FLT
  401. OCCURENCES:PC
  402. PROGRAMS:Autodesk Animator Pro
  403. REFERENCE:
  404. SEE ALSO:FLIc,FLC,CEL,COL
  405. VALIDATION:
  406.  
  407.